***** REPLICATION FILES ******

* Use "Dataset_Manifestos.dta"
* The following code from the 
 

local figure1 1
local figure2 1
local figure3 1
local figure4 1
local figure5 1
local figure6 1
local figure7 1
local figure8 1
local figure8 1
local figure9 1




if `figure1'==1 { 
 
 graph twoway  (lpoly lr_ratio_ae_funding1  year) ///
  (lpoly lr_ratio_ae_access1  year) ///
  (lpoly lr_ratio_ae_comp1  year),    ///
 xtitle("Year") ytitle("Ratio of Left to Right Total Mentions") ///
 legend(order(1 "Funding" 2 "Access" 3 "De-streaming")) ///
 title("Substance: Relative Left Attention") ///
  name(ratio1, replace)

 
 graph twoway  (lpoly lr_ratio_ae_funding  year) ///
  (lpoly lr_ratio_ae_access  year) ///
  (lpoly lr_ratio_ae_comp  year),    ///
 xtitle("Year") ytitle("Ratio of Left to Right Positive Mentions") ///
 legend(order(1 "Funding" 2 "Access" 3 "De-streaming")) ///
 title("Stance: Relative Left Positive Attention") ///
 yline(1, lcolor(gs12)) name(ratio2, replace)

 
  grc1leg ratio1 ratio2, legendfrom(ratio1) title("Substance and Stance") 
 graph export "$gdir/FIGURE_1.png", as(png)  replace

 
}
if `figure2'==1 {
	
graph twoway (lpoly ae_total decade) (lpoly pg_total decade) (lpoly sc_total decade), legend(order(1 "Distribution" 2 "Governance" 3 "Content")) xtitle("Year") title(" ")	ytitle("Share of All Educational Sentences")

graph export "$gdir/FIGURE_2.png", as(png)  replace
	
	
}
if `figure3'==1 { 
	

***RELATIVE** 
set more off

reg ae_funding_total_share i.left##i.decade i.prime  gdp_pop emp_pop i.ccode, cluster(cy)
eststo m1
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(ae1, replace) title("Funding") xtitle("") ytitle("Predicted Share of Education Mentions")


reg ae_funding_ratio i.left##i.decade prime gdp_pop emp_pop i.ccode, cluster(cy)
eststo m2
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(ae12, replace) title("Funding") xtitle("") ytitle("Predicted Positive Share of Mentions")

reg ae_access_total_share i.left##i.decade i.prime  gdp_pop emp_pop i.ccode, cluster(cy)
eststo m1
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(ae2, replace) title("Access") xtitle("") ytitle("")


set more off
reg ae_access_ratio i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m2
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(ae22, replace) title("Access") xtitle("") ytitle("")


set more off
reg ae_comp_total_share i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m3
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(ae3, replace) title("De-streaming") xtitle("") ytitle("")


set more off
reg ae_comp_ratio i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m4
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(ae32, replace) title("De-streaming") xtitle("") ytitle("")


grc1leg  ae1 ae2 ae3, ycommon name(x1, replace) legendfrom(ae1) cols(3) title("Substance: Share of Mentions")
grc1leg  ae12  ae22 ae32, ycommon  name(x2, replace) legendfrom(ae12) cols(3) title("Stance: Positive Share")

grc1leg  x1 x2, legendfrom(x1) cols(1)



graph export "$gdir/FIGURE3_AE_Mention_Type.png", as(png)  replace



}
if `figure4' ==1 {
set more off
reg ae_funding_total_share i.left##c.party_edu_stan party_religion  prime gdp_pop emp_pop i.decade i.ccode, cluster(cy)
margins, at(party_edu_stan=(-.25(.25).75) left=0 left=1)
marginsplot, addplot(hist party_edu_stan, percent fcolor(none) lcolor(gs12) yaxis(2) yscale(alt axis(2))) level(90) ///
    plot1opts(lcolor(black)) plot2opts(lcolor(gs12)) ///
    xtitle("Education Level of Base (Low to High)", margin(medium)) ///
    legend(pos(6) row(1)) ///
    xlabel(-.25(0.25).75, labsize(small)) ///
 graphregion(color(white) margin(l+0.1 r+0.1 t+0.1 b+0.3)) ///
    plotregion(margin(l+0.1 r+0.1 t+0.1 b+0.1)) ytitle("") ///
    name(ae1, replace) ///
    title("Funding") ytitle("Predicted Share of Education Mentions")

set more off
reg ae_access_total_share i.left##c.party_edu_stan party_religion prime gdp_pop emp_pop i.decade i.ccode, cluster(cy)
margins, at(party_edu_stan=(-.25(.25).75) left=0 left=1)
marginsplot, addplot(hist party_edu_stan, percent fcolor(none) lcolor(gs12) yaxis(2) yscale(alt axis(2))) level(90) ///
    plot1opts(lcolor(black)) plot2opts(lcolor(gs12)) ///
    xtitle("Education Level of Base (Low to High)", margin(medium)) ///
    legend(pos(6) row(1)) ///
    xlabel(-.25(0.25).75, labsize(small)) ///
 graphregion(color(white) margin(l+0.1 r+0.1 t+0.1 b+0.3)) ///
    plotregion(margin(l+0.1 r+0.1 t+0.1 b+0.1)) ytitle("") ///
    name(ae2, replace) ///
    title("Access") ytitle("")

  



  
  
reg ae_comp_total_share i.left##c.party_edu_stan party_religion prime gdp_pop emp_pop i.decade i. ccode, cluster(cy)
margins, at(party_edu_stan=(-.25(.25).75) left=0 left=1)
marginsplot, addplot(hist party_edu_stan, percent fcolor(none) lcolor(gs12) yaxis(2) yscale(alt axis(2))) level(90) ///
    plot1opts(lcolor(black)) plot2opts(lcolor(gs12)) ///
    xtitle("Education Level of Base (Low to High)", margin(medium)) ///
    xlabel(-.25(0.25).75, labsize(small)) ///
    legend(pos(6) row(1)) ///
    graphregion(color(white) margin(l+0.1 r+0.1 t+0.1 b+0.3)) ///
    plotregion(margin(l+0.1 r+0.1 t+0.1 b+0.1)) ytitle("") ///
    name(ae3, replace) ///
    title("De-Streaming") ytitle("")

  
    reg ae_funding_ratio i.left##c.party_edu_stan party_religion prime gdp_pop emp_pop i.decade i. ccode, cluster(cy)
margins, at(party_edu_stan=(-.25(.25).75) left=0 left=1)
marginsplot, addplot(hist party_edu_stan, percent fcolor(none) lcolor(gs12) yaxis(2) yscale(alt axis(2))) level(90) ///
    plot1opts(lcolor(black)) plot2opts(lcolor(gs12)) ///
    xtitle("Education Level of Base (Low to High)", margin(medium)) ///
    xlabel(-.25(0.25).75, labsize(small)) ///
    yscale(range(0 1)) ///
    legend(pos(6) row(1)) ///
    graphregion(color(white) margin(l+0.1 r+0.1 t+0.1 b+0.3)) ///
    plotregion(margin(l+0.1 r+0.1 t+0.1 b+0.1)) ytitle("") ///
    name(ae11, replace)  ///
	    title("Funding") ytitle("Predicted Positive Share of Mentions")

    reg ae_access_ratio i.left##c.party_edu_stan party_religion prime gdp_pop emp_pop i.decade i. ccode, cluster(cy)
margins, at(party_edu_stan=(-.25(.25).75) left=0 left=1)
marginsplot, addplot(hist party_edu_stan, percent fcolor(none) lcolor(gs12) yaxis(2) yscale(alt axis(2))) level(90) ///
    plot1opts(lcolor(black)) plot2opts(lcolor(gs12)) ///
    xtitle("Education Level of Base (Low to High)", margin(medium)) ///
    xlabel(-.25(0.25).75, labsize(small)) ///
    yscale(range(0 1)) ///
    legend(pos(6) row(1)) ///
    graphregion(color(white) margin(l+0.1 r+0.1 t+0.1 b+0.3)) ///
    plotregion(margin(l+0.1 r+0.1 t+0.1 b+0.1)) ytitle("") ///
    name(ae12, replace)  ///
	    title("Access") ytitle("")



reg ae_comp_ratio   i.left##c.party_edu_stan party_religion prime gdp_pop emp_pop i.decade i. ccode, cluster(cy)
margins, at(party_edu_stan=(-.25(.25).75) left=0 left=1)
marginsplot, addplot(hist party_edu_stan, percent fcolor(none) lcolor(gs12) yaxis(2) yscale(alt axis(2))) level(90) ///
    plot1opts(lcolor(black)) plot2opts(lcolor(gs12)) ///
    xtitle("Education Level of Base (Low to High)", margin(medium)) ///
    xlabel(-.25(0.25).75, labsize(small)) ///
    legend(pos(6) row(1) order(2 "Mainstream Right" 1 "Mainstream Left" 3 "Share of Parties")) ///
    graphregion(color(white) margin(l+0.1 r+0.1 t+0.1 b+0.3)) ///
    plotregion(margin(l+0.1 r+0.1 t+0.1 b+0.1)) ytitle("") ///
    name(ae13, replace) ///
    title("De-Streaming") ytitle("")

grc1leg  ae1 ae2 ae3, ycommon name(x1, replace) legendfrom(ae1) cols(3) title("Substance: Share of Mentions")
grc1leg ae11 ae12  ae13 , ycommon  name(x2, replace) legendfrom(ae11)  cols(3) title("Stance: Positive Share")

grc1leg  x1 x2, legendfrom(x2) cols(1)


graph export "$gdir/FIGURE4_AE_Mention_EDbase_STAN.png", as(png)  replace





}
if `figure5'==1 { 



set more off
reg  pg_market_total_share i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m1
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))   ytitle("")  ///
name(pg1, replace) title("Markets") xtitle("") ytitle("Predicted Share of Education Mentions")


set more off
reg pg_market_ratio i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m2
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ytitle("") ///
name(pg12, replace) title("Markets") xtitle("") ytitle("Predicted Positive Share of Mentions")


set more off
reg pg_dec_total_share i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m3
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ytitle("")  ///
name(pg2, replace) title("Decentralization") xtitle("") ytitle("")

set more off
reg pg_dec_ratio i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m4
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))   ytitle("") ///
name(pg22, replace) title("Decentralization") xtitle("") ytitle("")


set more off
reg pg_partic_total_share i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m3
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ytitle("")  ///
name(pg3, replace) title("Participation") xtitle("") ytitle("")

set more off
reg pg_partic_ratio i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m4
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))   ytitle("") ///
name(pg32, replace) title("Participation") xtitle("") ytitle("")

grc1leg  pg1 pg2 pg3, ycommon name(x1, replace) legendfrom(pg1) title("Substance: Share of Mentions") cols(3)
grc1leg  pg12  pg22 pg32, ycommon  name(x2, replace) legendfrom(pg12) title("Stance: Positive Share") cols(3)

grc1leg  x1 x2, legendfrom(x1) cols(1) ///
    graphregion(color(white) margin(l+0.1 r+0.1 t+0.1 b+0.3)) ///
    plotregion(margin(l+0.1 r+0.1 t+0.1 b+0.1)) 



graph export "$gdir/Figure5_PG_Mention_Type.png", as(png)  replace
}
if `figure6'==1 {
    
reg pg_market_total_share i.left##c.party_religion party_edu_stan prime gdp_pop emp_pop i.decade i.ccode, cluster(cy)
margins, at(party_religion=(-.2(.1).2) left=0 left=1) 
marginsplot, addplot(hist party_religion, percent fcolor(none) lcolor(gs12) yaxis(2) yscale(alt axis(2))) level(90) ///
    plot1opts(lcolor(black)) plot2opts(lcolor(gs12)) ///
    xtitle("Secular Base (Low to High)", margin(medium)) ///
    xlabel(-.25(0.25).25, labsize(small)) ///
    legend(pos(6) row(1)) ///
    graphregion(color(white) margin(l+0.1 r+0.1 t+0.1 b+0.3)) ///
    plotregion(margin(l+0.1 r+0.1 t+0.1 b+0.1)) ytitle("") ///
    name(pg2, replace) ///
    title("Mentions - Markets") ytitle("Predicted Share of Education Mentions")

  
  
reg pg_market_ratio i.left##c.party_religion party_edu_stan prime gdp_pop emp_pop i.decade i.ccode, vce(cluster cy)


fracreg logit pg_market_ratio i.left##c.party_religion party_edu_stan prime gdp_pop emp_pop i.decade i.ccode, vce(cluster cy)

margins, at(party_religion=(-.2(.1).2) left=0 left=1) 
marginsplot, addplot(hist party_religion, percent fcolor(none) lcolor(gs12) yaxis(2) yscale(alt axis(2))) level(90) ///
    plot1opts(lcolor(black)) plot2opts(lcolor(gs12)) ///
    xtitle("Secular Base (Low to High)", margin(medium)) ///
    xlabel(-.2(0.2).2, labsize(small)) ///
    legend(pos(6) row(1)) ///
    graphregion(color(white) margin(l+0.1 r+0.1 t+0.1 b+0.3)) ///
    plotregion(margin(l+0.1 r+0.1 t+0.1 b+0.1)) ytitle("") ///
    name(pg22, replace) ///
    title("Positive - Markets") ytitle("Predicted Share Positive Mentions")

  
grc1leg  pg2  pg22,   name(x2, replace) legendfrom(pg2)


graph export "$gdir/FIGURE6_PG_Mention_Regbase.png", as(png)  replace
	
	
	
}
if `figure7'==1 { 


set more off
reg sc_trad_total_share i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m1
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(sc1, replace) title("Traditionalism") xtitle("") ytitle("Predicted Share of Education Mentions")


set more off
reg sc_trad_ratio i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m2
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(sc12, replace) title("Traditionalism") xtitle("") ytitle("")
 


set more off
reg sc_aca_total_share i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m3
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(sc2, replace) title("Academics") xtitle("") ytitle("")


set more off
reg sc_aca_ratio i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m4
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(sc22, replace) title("Academics") xtitle("") ytitle("Predicted Share Positive Mentions")


set more off
reg sc_qual_total_share i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m3
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(sc3, replace) title("Quality") xtitle("") ytitle("")


set more off
reg sc_qual_ratio i.left##i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
eststo m4
margins, at ( decade=(1950(10)2010) left=0 left=1)
mplotoffset, offset(.8) xdim(decade)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(sc32, replace) title("Quality") xtitle("") ytitle("")


grc1leg  sc1 sc2 sc3, ycommon name(x1, replace) legendfrom(sc1) cols(3) title("Substance: Share of Mentions")
grc1leg  sc12  sc22 sc32, ycommon  name(x2, replace) legendfrom(sc12) title("Stance: Positive Share") cols(3)

grc1leg  x1 x2, legendfrom(x1) cols(1)
graph export "$gdir/Figure7_SC_Mention_Type.png", as(png)  replace



}
if `figure8'==1 { 
	
reg sc_trad_total_share i.left##c.party_religion party_edu_stan prime gdp_pop emp_pop i.decade i.ccode, cluster(cy)
margins, at(party_religion=(-.2(.1).2) left=0 left=1) 
marginsplot, addplot(hist party_religion, percent fcolor(none) lcolor(gs12) yaxis(2) yscale(alt axis(2))) level(90) ///
    plot1opts(lcolor(black)) plot2opts(lcolor(gs12)) ///
    xtitle("Secular Base (Low to High)", margin(medium)) ///
    xlabel(-.25(0.25).25, labsize(small)) ///
    legend(pos(6) row(1)) ///
    graphregion(color(white) margin(l+0.1 r+0.1 t+0.1 b+0.3)) ///
    plotregion(margin(l+0.1 r+0.1 t+0.1 b+0.1)) ytitle("") ///
    name(sc2, replace) ytitle("") ///
    title("Mentions - Tradition") ytitle("Predicted Share of Education Mentions")

  
  
reg sc_trad_ratio i.left##c.party_religion party_edu_stan prime gdp_pop emp_pop i.decade i.ccode, cluster(cy)
margins, at(party_religion=(-.2(.1).2) left=0 left=1) 
marginsplot, addplot(hist party_religion, percent fcolor(none) lcolor(gs12) yaxis(2) yscale(alt axis(2))) level(90) ///
    plot1opts(lcolor(black)) plot2opts(lcolor(gs12)) ///
    xtitle("Secular Base (Low to High)", margin(medium)) ///
    xlabel(-.25(0.25).25, labsize(small)) ///
    legend(pos(6) row(1)) ///
    graphregion(color(white) margin(l+0.1 r+0.1 t+0.1 b+0.3)) ///
    plotregion(margin(l+0.1 r+0.1 t+0.1 b+0.1)) ytitle("") ///
    name(sc22, replace) ytitle("") ///
    title("Positive - Tradition") ytitle("Predicted Share Positive Mentions")

  
grc1leg  sc2 sc22, legendfrom(sc2) cols(2)
graph export "$gdir/Figure8_SC_Mention_Regbase.png", as(png)  replace

	
	
	


}
if `figure9' ==1 {

set more off 
reg ae_funaccess_total_share i.left##c.bl_secondary i.decade prime gdp_pop emp_pop i.ccode , cluster(cy) 
margins, at ( bl_secondary=(.40(.30)1) left=0 left=1)
mplotoffset, offset(.01) xdim(bl_secondary)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(ae1, replace) title("Funding and Access") xtitle("") ytitle("Predicted Share of Education Mentions")


set more off
reg ae_funaccess_ratio i.left##c.bl_secondary i.decade prime gdp_pop emp_pop i.ccode , cluster(cy) 
margins, at ( bl_secondary=(.40(.30)1) left=0 left=1)
mplotoffset, offset(.01) xdim(bl_secondary)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(ae12, replace) title("Funding and Access") xtitle("") ytitle("Predicted Share Positive Mentions")

set more off 
reg ae_comp_total_share i.left##c.bl_secondary i.decade prime gdp_pop emp_pop i.ccode , cluster(cy) 
margins, at ( bl_secondary=(.40(.30)1) left=0 left=1)
mplotoffset, offset(.01) xdim(bl_secondary)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(ae2, replace) title("De-Streaming") xtitle("") ytitle("")


set more off
reg ae_comp_ratio i.left##c.bl_secondary i.decade prime gdp_pop emp_pop i.ccode , cluster(cy) 
margins, at ( bl_secondary=(.40(.30)1) left=0 left=1)
mplotoffset, offset(.01) xdim(bl_secondary)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(ae22, replace) title("De-Streaming") xtitle("") ytitle("")

set more off
reg pg_market_total_share i.left##c.bl_secondary i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
margins, at ( bl_secondary=(.40(.30)1) left=0 left=1)
mplotoffset, offset(.01) xdim(bl_secondary)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(pg1, replace) title("Markets") xtitle("") ytitle("")


set more off
reg pg_market_ratio i.left##c.bl_secondary i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
margins, at ( bl_secondary=(.40(.30)1) left=0 left=1)
mplotoffset, offset(.01) xdim(bl_secondary)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(pg12, replace) title("Markets") xtitle("") ytitle("")



set more off
reg sc_trad_total_share i.left##c.bl_secondary i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
margins, at ( bl_secondary=(.40(.30)1) left=0 left=1)
mplotoffset, offset(.01) xdim(bl_secondary)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(sc1, replace) title("Traditionalism") xtitle("") ytitle("")


set more off
reg sc_trad_ratio i.left##c.bl_secondary i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
margins, at ( bl_secondary=(.40(.30)1) left=0 left=1)
mplotoffset, offset(.01) xdim(bl_secondary)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(sc12, replace) title("Traditionalism") xtitle("") ytitle("")



set more off
reg sc_acaqu_total_share i.left##c.bl_secondary i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
margins, at ( bl_secondary=(.40(.30)1) left=0 left=1)
mplotoffset, offset(.01) xdim(bl_secondary)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(sc2, replace) title("Quality and Academics - Mentions") xtitle("") ytitle("")


set more off
reg sc_acaqu_ratio i.left##c.bl_secondary i.decade prime gdp_pop emp_pop i. ccode, cluster(cy)
margins, at ( bl_secondary=(.40(.30)1) left=0 left=1)
mplotoffset, offset(.01) xdim(bl_secondary)   recast(scatter) ciopts(recast(rspike))  ///
  legend(pos(6) row(1))   graphregion(color(white))  ///
name(sc22, replace) title("Quality and Academics - Positive Share") xtitle("") ytitle("")



grc1leg  ae1 ae2 pg1 sc1, ycommon name(x1, replace) legendfrom(ae1) cols(4) title("Substance: Share of Mentions")
grc1leg  ae12 ae22 pg12 sc12, ycommon  name(x2, replace) legendfrom(ae12) cols(4)  title("Stance: Positive Share")

grc1leg  x1 x2, legendfrom(x1) cols(1)
graph export "$gdir/Figure9_Inst.png", as(png)  replace



}
}
